(0) Obligation:
JBC Problem based on JBC Program:
Manifest-Version: 1.0
Created-By: 1.6.0_22 (Sun Microsystems Inc.)
Main-Class: TwoWay/TwoWay
package TwoWay;
public class Random {
static String[] args;
static int index = 0;
public static int random() {
final String string = args[index];
index++;
return string.length();
}
}
package TwoWay;
public class TwoWay {
public static void main(String[] args) {
Random.args = args;
twoWay(true, Random.random());
}
public static int twoWay(boolean terminate, int n) {
if (n < 0) {
return 1;
} else {
int m = n;
if (terminate) {
m--;
} else {
m++;
}
return m*twoWay(terminate, m);
}
}
}
(1) JBC2FIG (SOUND transformation)
Constructed FIGraph.
(2) Obligation:
FIGraph based on JBC Program:
TwoWay.TwoWay.main([Ljava/lang/String;)V: Graph of 86 nodes with 0 SCCs.
TwoWay.TwoWay.twoWay(ZI)I: Graph of 29 nodes with 0 SCCs.
(3) FIGtoITRSProof (SOUND transformation)
Transformed FIGraph SCCs to IDPs. Logs:
Log for SCC 0: Generated 15 rules for P and 14 rules for R.
Combined rules. Obtained 1 rules for P and 4 rules for R.
Filtered ground terms:
329_1_twoWay_InvokeMethod(x1, x2, x3, x4) → 329_1_twoWay_InvokeMethod(x1, x2, x4)
275_0_twoWay_GE(x1, x2, x3, x4) → 275_0_twoWay_GE(x3, x4)
Cond_275_0_twoWay_GE(x1, x2, x3, x4, x5) → Cond_275_0_twoWay_GE(x1, x4, x5)
357_0_twoWay_Return(x1, x2) → 357_0_twoWay_Return(x2)
Cond_329_1_twoWay_InvokeMethod1(x1, x2, x3, x4, x5) → Cond_329_1_twoWay_InvokeMethod1(x1, x2, x3, x5)
Cond_329_1_twoWay_InvokeMethod(x1, x2, x3, x4, x5) → Cond_329_1_twoWay_InvokeMethod(x1, x3, x5)
340_0_twoWay_Return(x1, x2) → 340_0_twoWay_Return
301_0_twoWay_Return(x1, x2, x3, x4) → 301_0_twoWay_Return
Filtered duplicate args:
329_1_twoWay_InvokeMethod(x1, x2, x3) → 329_1_twoWay_InvokeMethod(x1, x3)
275_0_twoWay_GE(x1, x2) → 275_0_twoWay_GE(x2)
Cond_275_0_twoWay_GE(x1, x2, x3) → Cond_275_0_twoWay_GE(x1, x3)
Cond_329_1_twoWay_InvokeMethod1(x1, x2, x3, x4) → Cond_329_1_twoWay_InvokeMethod1(x1, x2, x4)
Cond_329_1_twoWay_InvokeMethod(x1, x2, x3) → Cond_329_1_twoWay_InvokeMethod(x1, x3)
Combined rules. Obtained 1 rules for P and 4 rules for R.
Finished conversion. Obtained 1 rules for P and 4 rules for R. System has predefined symbols.
(4) Obligation:
IDP problem:
The following function symbols are pre-defined:
!= | ~ | Neq: (Integer, Integer) -> Boolean |
* | ~ | Mul: (Integer, Integer) -> Integer |
>= | ~ | Ge: (Integer, Integer) -> Boolean |
-1 | ~ | UnaryMinus: (Integer) -> Integer |
| | ~ | Bwor: (Integer, Integer) -> Integer |
/ | ~ | Div: (Integer, Integer) -> Integer |
= | ~ | Eq: (Integer, Integer) -> Boolean |
| ~ | Bwxor: (Integer, Integer) -> Integer |
|| | ~ | Lor: (Boolean, Boolean) -> Boolean |
! | ~ | Lnot: (Boolean) -> Boolean |
< | ~ | Lt: (Integer, Integer) -> Boolean |
- | ~ | Sub: (Integer, Integer) -> Integer |
<= | ~ | Le: (Integer, Integer) -> Boolean |
> | ~ | Gt: (Integer, Integer) -> Boolean |
~ | ~ | Bwnot: (Integer) -> Integer |
% | ~ | Mod: (Integer, Integer) -> Integer |
& | ~ | Bwand: (Integer, Integer) -> Integer |
+ | ~ | Add: (Integer, Integer) -> Integer |
&& | ~ | Land: (Boolean, Boolean) -> Boolean |
The following domains are used:
Integer
The ITRS R consists of the following rules:
275_0_twoWay_GE(
-1) →
Cond_275_0_twoWay_GE(
0 > -1,
-1)
Cond_275_0_twoWay_GE(
TRUE,
-1) →
301_0_twoWay_Return329_1_twoWay_InvokeMethod(
301_0_twoWay_Return,
-1) →
357_0_twoWay_Return(
-1)
329_1_twoWay_InvokeMethod(
340_0_twoWay_Return,
x1) →
Cond_329_1_twoWay_InvokeMethod(
1 > -1,
340_0_twoWay_Return,
x1)
Cond_329_1_twoWay_InvokeMethod(
TRUE,
340_0_twoWay_Return,
x1) →
357_0_twoWay_Return(
x1 * -1)
329_1_twoWay_InvokeMethod(
357_0_twoWay_Return(
x0),
x1) →
Cond_329_1_twoWay_InvokeMethod1(
x0 < 1,
357_0_twoWay_Return(
x0),
x1)
Cond_329_1_twoWay_InvokeMethod1(
TRUE,
357_0_twoWay_Return(
x0),
x1) →
357_0_twoWay_Return(
x1 * x0)
The integer pair graph contains the following rules and edges:
(0):
275_0_TWOWAY_GE(
x1[0]) →
COND_275_0_TWOWAY_GE(
x1[0] >= 0,
x1[0])
(1):
COND_275_0_TWOWAY_GE(
TRUE,
x1[1]) →
275_0_TWOWAY_GE(
x1[1] + -1)
(0) -> (1), if ((x1[0] >= 0 →* TRUE)∧(x1[0] →* x1[1]))
(1) -> (0), if ((x1[1] + -1 →* x1[0]))
The set Q consists of the following terms:
275_0_twoWay_GE(
-1)
Cond_275_0_twoWay_GE(
TRUE,
-1)
329_1_twoWay_InvokeMethod(
301_0_twoWay_Return,
-1)
329_1_twoWay_InvokeMethod(
340_0_twoWay_Return,
x0)
Cond_329_1_twoWay_InvokeMethod(
TRUE,
340_0_twoWay_Return,
x0)
329_1_twoWay_InvokeMethod(
357_0_twoWay_Return(
x0),
x1)
Cond_329_1_twoWay_InvokeMethod1(
TRUE,
357_0_twoWay_Return(
x0),
x1)
(5) IDPNonInfProof (SOUND transformation)
The constraints were generated the following way:
The DP Problem is simplified using the Induction Calculus [NONINF] with the following steps:
Note that
final constraints are written in
bold face.
For Pair
275_0_TWOWAY_GE(
x1) →
COND_275_0_TWOWAY_GE(
>=(
x1,
0),
x1) the following chains were created:
- We consider the chain 275_0_TWOWAY_GE(x1[0]) → COND_275_0_TWOWAY_GE(>=(x1[0], 0), x1[0]), COND_275_0_TWOWAY_GE(TRUE, x1[1]) → 275_0_TWOWAY_GE(+(x1[1], -1)) which results in the following constraint:
(1) (>=(x1[0], 0)=TRUE∧x1[0]=x1[1] ⇒ 275_0_TWOWAY_GE(x1[0])≥NonInfC∧275_0_TWOWAY_GE(x1[0])≥COND_275_0_TWOWAY_GE(>=(x1[0], 0), x1[0])∧(UIncreasing(COND_275_0_TWOWAY_GE(>=(x1[0], 0), x1[0])), ≥))
We simplified constraint (1) using rule (IV) which results in the following new constraint:
(2) (>=(x1[0], 0)=TRUE ⇒ 275_0_TWOWAY_GE(x1[0])≥NonInfC∧275_0_TWOWAY_GE(x1[0])≥COND_275_0_TWOWAY_GE(>=(x1[0], 0), x1[0])∧(UIncreasing(COND_275_0_TWOWAY_GE(>=(x1[0], 0), x1[0])), ≥))
We simplified constraint (2) using rule (POLY_CONSTRAINTS) which results in the following new constraint:
(3) (x1[0] ≥ 0 ⇒ (UIncreasing(COND_275_0_TWOWAY_GE(>=(x1[0], 0), x1[0])), ≥)∧[(-1)Bound*bni_21] + [(2)bni_21]x1[0] ≥ 0∧[(-1)bso_22] ≥ 0)
We simplified constraint (3) using rule (IDP_POLY_SIMPLIFY) which results in the following new constraint:
(4) (x1[0] ≥ 0 ⇒ (UIncreasing(COND_275_0_TWOWAY_GE(>=(x1[0], 0), x1[0])), ≥)∧[(-1)Bound*bni_21] + [(2)bni_21]x1[0] ≥ 0∧[(-1)bso_22] ≥ 0)
We simplified constraint (4) using rule (POLY_REMOVE_MIN_MAX) which results in the following new constraint:
(5) (x1[0] ≥ 0 ⇒ (UIncreasing(COND_275_0_TWOWAY_GE(>=(x1[0], 0), x1[0])), ≥)∧[(-1)Bound*bni_21] + [(2)bni_21]x1[0] ≥ 0∧[(-1)bso_22] ≥ 0)
For Pair
COND_275_0_TWOWAY_GE(
TRUE,
x1) →
275_0_TWOWAY_GE(
+(
x1,
-1)) the following chains were created:
- We consider the chain COND_275_0_TWOWAY_GE(TRUE, x1[1]) → 275_0_TWOWAY_GE(+(x1[1], -1)) which results in the following constraint:
(6) (COND_275_0_TWOWAY_GE(TRUE, x1[1])≥NonInfC∧COND_275_0_TWOWAY_GE(TRUE, x1[1])≥275_0_TWOWAY_GE(+(x1[1], -1))∧(UIncreasing(275_0_TWOWAY_GE(+(x1[1], -1))), ≥))
We simplified constraint (6) using rule (POLY_CONSTRAINTS) which results in the following new constraint:
(7) ((UIncreasing(275_0_TWOWAY_GE(+(x1[1], -1))), ≥)∧[2 + (-1)bso_24] ≥ 0)
We simplified constraint (7) using rule (IDP_POLY_SIMPLIFY) which results in the following new constraint:
(8) ((UIncreasing(275_0_TWOWAY_GE(+(x1[1], -1))), ≥)∧[2 + (-1)bso_24] ≥ 0)
We simplified constraint (8) using rule (POLY_REMOVE_MIN_MAX) which results in the following new constraint:
(9) ((UIncreasing(275_0_TWOWAY_GE(+(x1[1], -1))), ≥)∧[2 + (-1)bso_24] ≥ 0)
We simplified constraint (9) using rule (IDP_UNRESTRICTED_VARS) which results in the following new constraint:
(10) ((UIncreasing(275_0_TWOWAY_GE(+(x1[1], -1))), ≥)∧0 = 0∧[2 + (-1)bso_24] ≥ 0)
To summarize, we get the following constraints P
≥ for the following pairs.
- 275_0_TWOWAY_GE(x1) → COND_275_0_TWOWAY_GE(>=(x1, 0), x1)
- (x1[0] ≥ 0 ⇒ (UIncreasing(COND_275_0_TWOWAY_GE(>=(x1[0], 0), x1[0])), ≥)∧[(-1)Bound*bni_21] + [(2)bni_21]x1[0] ≥ 0∧[(-1)bso_22] ≥ 0)
- COND_275_0_TWOWAY_GE(TRUE, x1) → 275_0_TWOWAY_GE(+(x1, -1))
- ((UIncreasing(275_0_TWOWAY_GE(+(x1[1], -1))), ≥)∧0 = 0∧[2 + (-1)bso_24] ≥ 0)
The constraints for P
> respective P
bound are constructed from P
≥ where we just replace every occurence of "t ≥ s" in P
≥ by "t > s" respective "t ≥
c". Here
c stands for the fresh constant used for P
bound.
Using the following integer polynomial ordering the resulting constraints can be solved
Polynomial interpretation over integers[POLO]:
POL(TRUE) = 0
POL(FALSE) = 0
POL(275_0_twoWay_GE(x1)) = [-1]
POL(-1) = [-1]
POL(Cond_275_0_twoWay_GE(x1, x2)) = [-1]
POL(>(x1, x2)) = [-1]
POL(0) = 0
POL(301_0_twoWay_Return) = [-1]
POL(329_1_twoWay_InvokeMethod(x1, x2)) = [-1] + [-1]x1
POL(357_0_twoWay_Return(x1)) = x1
POL(340_0_twoWay_Return) = [-1]
POL(Cond_329_1_twoWay_InvokeMethod(x1, x2, x3)) = [-1] + [-1]x3
POL(1) = [1]
POL(*(x1, x2)) = x1·x2
POL(Cond_329_1_twoWay_InvokeMethod1(x1, x2, x3)) = [-1] + [-1]x3 + [-1]x2
POL(<(x1, x2)) = [-1]
POL(275_0_TWOWAY_GE(x1)) = [2]x1
POL(COND_275_0_TWOWAY_GE(x1, x2)) = [2]x2
POL(>=(x1, x2)) = [-1]
POL(+(x1, x2)) = x1 + x2
The following pairs are in P
>:
COND_275_0_TWOWAY_GE(TRUE, x1[1]) → 275_0_TWOWAY_GE(+(x1[1], -1))
The following pairs are in P
bound:
275_0_TWOWAY_GE(x1[0]) → COND_275_0_TWOWAY_GE(>=(x1[0], 0), x1[0])
The following pairs are in P
≥:
275_0_TWOWAY_GE(x1[0]) → COND_275_0_TWOWAY_GE(>=(x1[0], 0), x1[0])
There are no usable rules.
(6) Complex Obligation (AND)
(7) Obligation:
IDP problem:
The following function symbols are pre-defined:
!= | ~ | Neq: (Integer, Integer) -> Boolean |
* | ~ | Mul: (Integer, Integer) -> Integer |
>= | ~ | Ge: (Integer, Integer) -> Boolean |
-1 | ~ | UnaryMinus: (Integer) -> Integer |
| | ~ | Bwor: (Integer, Integer) -> Integer |
/ | ~ | Div: (Integer, Integer) -> Integer |
= | ~ | Eq: (Integer, Integer) -> Boolean |
| ~ | Bwxor: (Integer, Integer) -> Integer |
|| | ~ | Lor: (Boolean, Boolean) -> Boolean |
! | ~ | Lnot: (Boolean) -> Boolean |
< | ~ | Lt: (Integer, Integer) -> Boolean |
- | ~ | Sub: (Integer, Integer) -> Integer |
<= | ~ | Le: (Integer, Integer) -> Boolean |
> | ~ | Gt: (Integer, Integer) -> Boolean |
~ | ~ | Bwnot: (Integer) -> Integer |
% | ~ | Mod: (Integer, Integer) -> Integer |
& | ~ | Bwand: (Integer, Integer) -> Integer |
+ | ~ | Add: (Integer, Integer) -> Integer |
&& | ~ | Land: (Boolean, Boolean) -> Boolean |
The following domains are used:
Integer
The ITRS R consists of the following rules:
275_0_twoWay_GE(
-1) →
Cond_275_0_twoWay_GE(
0 > -1,
-1)
Cond_275_0_twoWay_GE(
TRUE,
-1) →
301_0_twoWay_Return329_1_twoWay_InvokeMethod(
301_0_twoWay_Return,
-1) →
357_0_twoWay_Return(
-1)
329_1_twoWay_InvokeMethod(
340_0_twoWay_Return,
x1) →
Cond_329_1_twoWay_InvokeMethod(
1 > -1,
340_0_twoWay_Return,
x1)
Cond_329_1_twoWay_InvokeMethod(
TRUE,
340_0_twoWay_Return,
x1) →
357_0_twoWay_Return(
x1 * -1)
329_1_twoWay_InvokeMethod(
357_0_twoWay_Return(
x0),
x1) →
Cond_329_1_twoWay_InvokeMethod1(
x0 < 1,
357_0_twoWay_Return(
x0),
x1)
Cond_329_1_twoWay_InvokeMethod1(
TRUE,
357_0_twoWay_Return(
x0),
x1) →
357_0_twoWay_Return(
x1 * x0)
The integer pair graph contains the following rules and edges:
(0):
275_0_TWOWAY_GE(
x1[0]) →
COND_275_0_TWOWAY_GE(
x1[0] >= 0,
x1[0])
The set Q consists of the following terms:
275_0_twoWay_GE(
-1)
Cond_275_0_twoWay_GE(
TRUE,
-1)
329_1_twoWay_InvokeMethod(
301_0_twoWay_Return,
-1)
329_1_twoWay_InvokeMethod(
340_0_twoWay_Return,
x0)
Cond_329_1_twoWay_InvokeMethod(
TRUE,
340_0_twoWay_Return,
x0)
329_1_twoWay_InvokeMethod(
357_0_twoWay_Return(
x0),
x1)
Cond_329_1_twoWay_InvokeMethod1(
TRUE,
357_0_twoWay_Return(
x0),
x1)
(8) IDependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.
(9) TRUE
(10) Obligation:
IDP problem:
The following function symbols are pre-defined:
!= | ~ | Neq: (Integer, Integer) -> Boolean |
* | ~ | Mul: (Integer, Integer) -> Integer |
>= | ~ | Ge: (Integer, Integer) -> Boolean |
-1 | ~ | UnaryMinus: (Integer) -> Integer |
| | ~ | Bwor: (Integer, Integer) -> Integer |
/ | ~ | Div: (Integer, Integer) -> Integer |
= | ~ | Eq: (Integer, Integer) -> Boolean |
| ~ | Bwxor: (Integer, Integer) -> Integer |
|| | ~ | Lor: (Boolean, Boolean) -> Boolean |
! | ~ | Lnot: (Boolean) -> Boolean |
< | ~ | Lt: (Integer, Integer) -> Boolean |
- | ~ | Sub: (Integer, Integer) -> Integer |
<= | ~ | Le: (Integer, Integer) -> Boolean |
> | ~ | Gt: (Integer, Integer) -> Boolean |
~ | ~ | Bwnot: (Integer) -> Integer |
% | ~ | Mod: (Integer, Integer) -> Integer |
& | ~ | Bwand: (Integer, Integer) -> Integer |
+ | ~ | Add: (Integer, Integer) -> Integer |
&& | ~ | Land: (Boolean, Boolean) -> Boolean |
The following domains are used:
Integer
The ITRS R consists of the following rules:
275_0_twoWay_GE(
-1) →
Cond_275_0_twoWay_GE(
0 > -1,
-1)
Cond_275_0_twoWay_GE(
TRUE,
-1) →
301_0_twoWay_Return329_1_twoWay_InvokeMethod(
301_0_twoWay_Return,
-1) →
357_0_twoWay_Return(
-1)
329_1_twoWay_InvokeMethod(
340_0_twoWay_Return,
x1) →
Cond_329_1_twoWay_InvokeMethod(
1 > -1,
340_0_twoWay_Return,
x1)
Cond_329_1_twoWay_InvokeMethod(
TRUE,
340_0_twoWay_Return,
x1) →
357_0_twoWay_Return(
x1 * -1)
329_1_twoWay_InvokeMethod(
357_0_twoWay_Return(
x0),
x1) →
Cond_329_1_twoWay_InvokeMethod1(
x0 < 1,
357_0_twoWay_Return(
x0),
x1)
Cond_329_1_twoWay_InvokeMethod1(
TRUE,
357_0_twoWay_Return(
x0),
x1) →
357_0_twoWay_Return(
x1 * x0)
The integer pair graph contains the following rules and edges:
(1):
COND_275_0_TWOWAY_GE(
TRUE,
x1[1]) →
275_0_TWOWAY_GE(
x1[1] + -1)
The set Q consists of the following terms:
275_0_twoWay_GE(
-1)
Cond_275_0_twoWay_GE(
TRUE,
-1)
329_1_twoWay_InvokeMethod(
301_0_twoWay_Return,
-1)
329_1_twoWay_InvokeMethod(
340_0_twoWay_Return,
x0)
Cond_329_1_twoWay_InvokeMethod(
TRUE,
340_0_twoWay_Return,
x0)
329_1_twoWay_InvokeMethod(
357_0_twoWay_Return(
x0),
x1)
Cond_329_1_twoWay_InvokeMethod1(
TRUE,
357_0_twoWay_Return(
x0),
x1)
(11) IDependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.
(12) TRUE